Terrain Analysis - Creating a Safe Haven after a Zombie Apocalypse
Introduction
The Zombie apocalypse has finally come! You've been living in a cave in the mountains for over a year and you've run out of food. Now you'll need a location where you can grow food and keep an eye out for roving herds of the undead. Much of Humboldt County was bombed trying to stop the zombies and the resulting fires burned everything to the ground. Fortunately, you had your laptop with you and had installed ArcMap on it before the apocalypse so you can use GIS to select the perfect spot for your new homestead! You'll need to find the largest area of south-facing land with a low slope.
Learning Outcomes
- Export to new file formats
- Mosaic to new raster
- Raster calculator
- Surface analyst tools (aspect, slope, and viewshed)
- Raster to polygon tool
Data
For this lab, use the DEMs we used for the Arcata Forest lab. However, you'll want to go back to the originals as we will be doing analysis across a large part of Humboldt County.
Walk Through: Workspace Preparation
- Set up your workspace/folder structure. Remember the file and folder name restrictions we warned you about in previous labs.
- Move the original DEMs into your originals folder.
Skill Drill 2: Creating a Mosaic
Please see this video for details on executing the steps below in ArcGIS Pro.
- Load the rasters into ArcGIS Pro.
- Check the pixel depth and spatial reference for the DEMs.
- Mosaic the two rasters into a new raster. Make sure to keep the pixel type as 32-bit floating point and the number of bands is 1.
- Project the raster into WGS84, UTM Zone 10 North. Make sure to use bilinear or cubic for the sampling method.
Walk Through: Creating a Slope Raster
Before going on, you'll want to check the units for the elevation values in the DEM. If they are not set to meters, you'll need to convert them or compute Z values. The problem is that the units are often missing from the metadata. You might need to check the documentation with the data set, the web site, or figure it out by looking at a topography map for the area you are working in and comparing the values on the topo to the DEM.
- Run the Slope tool in the toolbox
- Make sure you are using the correct DEM for the input.
- Give the output raster a good name like "Slope.img"
- Make sure the output will be in degrees.
- Set the Z factor if needed and run the tool.
- Next, use Raster Calculator for find the slope values that are greater than 1 and less than 5. This way our new homestead will have some drainage but will not be too steep for houses.
In Raster Calculator, "AND" operations are specified with the ampersand character ("&"). The "OR" operation is designated with a vertical "pipe" ("¦").
- When displayed in the data frame, areas where there slope is too steep will appear whatever color is assigned to the value 0, while areas where the slope is ideal for a homestead property will appear whatever color is assigned to the value 1.
Walk Through: Creating an Aspect Raster
The next step is to create an "aspect" raster. The "aspect" is the direction a slope is facing. People, and some plants, like to live on the south-facing slopes in northern latitudes because there is more exposure to the sun.
- Run the Aspect tool.
- Make sure you are using the correct DEM for the input raster.
- Save the "Output" raster in your working folder and name it "Aspect.img"
- Take a look at the values in the legend on the map. ArcMap finds aspect for each pixel in one of eight cardinal directions. These are colorized in 45 degree slices where 0 degrees is a north-facing slope (actually from 337.5 degrees to 22.5), 22.5 to 67.5 is a northeast facing slope, and so on going clockwise. Flat areas are set to -1 to show they do not have an aspect (i.e. they don't point in any direction).
If you want to visualize aspect with arrows that point "downhill" you'll need to use another GIS package, such as BlueSpray.
- Use Raster Calculator to create a raster with 1s where the aspect is generally south-facing, or between 135 and 225 degrees.
Note: You can perform the same function with the "Reclass" tool in ArcGIS but your results may vary because the tool does not allow you to specify what happens with integer values.
Pan around the map a bit and you'll notice some strange patterns just to the north of Arcata Bay. These are caused by not having enough precision in our DEM. If we were going to work in the flat lands, we would need a higher precision DEM.
Walk Through: Creating a Simple Model
You can now create a simple, initial model for your homestead/property by either using the "AND" function or by multiplying them together.
If your rasters are both just 0s and 1s, you can multiply them together and get exactly the same result as you would using the "AND" operator. Desirable cells will have a value of 1, and undesirable cells will have a value of 0.
- Use Raster Calculator to multiply the two rasters together.
- Take a look at the result and compare it with your original slope and aspect rasters.
Walk Through: Creating a Hillshade
- Create a hillshade from your DEM and compare it to your model to see if it makes sense.
Hillshades are rarely used in analysis, but are commonly used in producing maps, as they give us a better "feel" for what is happening with the terrain than a DEM, slope, or aspect raster.
Walk Through: Raster to Polygon
You should now have a raster of your simple model results, where suitable land is represented by a 1, and unsuitable land is represented by a 0. The analysis we want to do next requires we convert our potential suitable site areas into polygons.
Note that the "Raster to Polygon" tool, for some unknown reason, will fail if your file paths have any spaces in them. You'll want to replace the spaces with underscores ("_") before running the tool. In general, it is a bad idea to include any punctuation other than underscores in any folder or file names when working with GIS software.
- We no longer care about cells with a value of 0, so let's remove them. Use the Reclassify tool to reclassify all 0 values to "No Data". Remember you need to change the "new values", not "old values"
- Run the Raster to Polygon on your model results.
- Select your simple model as the "Input Raster"
- The "Field" value should only have one entry "Value" so just select this entry.
If you follow a different set of steps for the processing, you may need to select a different entry than "Value". This value will be inserted as the value for each raster pixel in the output so select the "Field" that will allow you to process the raster in the way you desire.
- Set the "Output" to your working folder and name it "PotentialSites.shp"
- Make sure the "Simplify Polygons" checkbox is unchecked. This will make the polygons follow the edges of the raster which is a more accurate representation of the data in the raster (i.e. you're not losing any information). If you're using the polygons for visualization, you will probably want to check "Simplify Polygons" because it will look better.
- Click "OK" and you should see a polygon feature layer appear.
Now we will select the best possible site for your new homestead.
- Open the "attribute" table for the raster and export it to a CSV file using the 3-bar menu to the right of the attribute table.
- In Excel, sort the areas to find the one with the ID that has the greatest area.
- Back in ArcGIS, select the fetaure with the largest area. This will be our homestead.
- Export the selected polygon with the largest area and save it to your working folder as a shapefile. Call it "homestead.shp".
- Remove any unnecessary layers from your table of contents.
- Don't forget to clear your selection.
Walk Through: Creating a Viewshed
A viewshed shows the area of land that can be viewed from a specific location. We'll want to select one potential site and then convert it to a point for the viewshed tool.
- Run the Feature to Point tool.
- Select your homestead shapefile as the input
- Make sure "Inside" is checked so you have a point within a shape
- Give the output a good name such as "LookoutTower.shp" and save it your working folder
- Run the Viewshed tool
- Select your original DEM as the input raster
- Select your new (point) homestead layer for the "Input points...features"
- Give the "Output Raster" a good name like "Viewshed.img" and save it to your working folder
- Click "OK"
- The resulting raster will show you the pixels in the raster that can theoretically be seen from your site points. Take a look at the result.
Your point may be on the top of a hill, or flat area which limits what is "visible." This is because the viewshed tool in ArcMap assumes that you are looking from ground level (i.e. like you're buried up to your eyes at the site point).
- Add an attribute to your "LookoutTower.shp" shapefile named "OFFSETA." This field has to be exactly this name (this is unusual in ArcGIS but check the help for more information). Set the "Type" to "Double."
- Set this value to 100 to indicate you want to see what the view is like from 100 meters above ground level (the height of the view from our second story house).
- Open the Viewshed tool again. This time, ArcMap should find the "OFFSETA" value and your viewshed should be larger. You may have to change the OFFSETA value to find the optimal height for your tower so you can see the zombies coming!